package com.ruoyi.system.utils.modbus;

import com.serotonin.modbus4j.ProcessImageListener;

/**
 * 监听线圈和寄存器，实现ProcessImageListener
 */
public class BasicProcessImageListener implements ProcessImageListener {

    @Override
    public void coilWrite(int offset, boolean oldValue, boolean newValue) {
        System.out.println("01指令 寄存器地址（offset）：" + offset + "," + "旧值： " + oldValue + " 新值： " + newValue);

    }

    @Override
    public void holdingRegisterWrite(int offset, short oldValue, short newValue) {
        System.out.println("03指令 寄存器地址（offset）：" + offset + "," + "旧值： " + oldValue + " 新值： " + newValue);
    }
}
